<template>
  <div id="loungerIndex">
    <!-- <lg-Loading :visible="visible"/> -->
    <!-- <lg-button-group>
      <lg-button>
        禁
      </lg-button>
      <lg-button>
        启
      </lg-button>
    </lg-button-group> -->
      <!-- <lg-button loading >
        测
      </lg-button> -->
      <lg-button  @click="onSuccess">
        测试一下
      </lg-button>
      <!-- <lg-dialog :visible.sync="visible"></lg-dialog> -->
      <!-- <lg-image v-for="(item,index) in list" :key="index" :index="index" :src="item" :previewSrcList="list" width="500" height="700"/> -->
      <!-- <lg-upload @originalFileSuccess="onSuccess" :limit="30" action="https://sit.cnicif.com/api/ce-digital/dsf/cos/uploadImageBaseNoPer" isDelete :data="{module: 1}" fileName="base64" fileFormat="base64" fileListShowType="list" :fileList="list" isView multiple>
      </lg-upload> -->
      <!-- <tailorPreview :option="option" :visible.sync="visible" @comfirm="onExceed" ref="tailor"/> -->
      <!-- <lg-Progress :percentage="percentage" :color="customColors"/> -->
  </div>
</template>

<script>
import lgButton from '@/components/Basic/button'
import lgButtonGroup from '@/components/Basic/buttonGroup'
import lgImage from '@/components/Others/image'
import lgUpload from '@/components/Form/upload'
import tailorPreview from '@/components/Others/tailor'
import lgDialog from '@/components/Others/dialog'
import lgProgress from '@/components/Data/progress'
// import lgLoading from '@/components/Notice/loading/index.vue'
import { MessageBox } from '@/components/index.js'
import { getUrlFileName, base64toBlob, blobToBase64  } from '@/libs/index.js'
export default {
  name: 'home',
  // lgLoading
  components: { lgButton, lgButtonGroup, lgImage, lgUpload, tailorPreview, lgProgress, lgDialog },
  data() {
    return {
      list: [
        'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg',
        'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg',
        'http://czl.mobi/txt.txt',
        'http://czl.mobi/docx.docx',
        'http://czl.mobi/xls.xls',
        'http://czl.mobi/video.mp4',
        'http://czl.mobi/pdf.pdf',
        'http://czl.mobi/ppt.ppt',
        'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0dc25941171jpeg.jpeg',
        'http://czl.mobi/ppt.rar',
        'http://czl.mobi/mp3.mp3',
        'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
        'http://czl.mobi/pdf2.pdf'
      ],
      imgList: [
        {
          url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg',
          name: '123.jpg'
        },
        {
          url: 'http://czl.mobi/pdf.pdf',
          name: '456.pdf'
        },
        {
          url: 'http://czl.mobi/mp3.mp3',
          name: '789.mp3'
        }
      ],
      srcArr: [],
      visible: false,
      percentage: 0,
      option:{
        img: ''
      },
      customColors: [
          {color: '#f56c6c', percentage: 20},
          {color: '#e6a23c', percentage: 40},
          {color: '#5cb87a', percentage: 60},
          {color: '#1989fa', percentage: 80},
          {color: '#6f7ad3', percentage: 100}
        ]
    }
  },
  created() {
    //  let id = setInterval(() => {
    //     this.percentage += 1
    //     if (this.percentage >= 100) {
    //        clearInterval(id)
    //     }
    //  }, 200)
  },
  methods: {
    onExceed (data) {
      console.log(data, 'data====A')
    },
    onSuccess (data) {
      this.$message({
        message: '真的很好玩'
      })
      // console.log(MessageBox, 'MessageBox')
        // const h = this.$createElement;
        // MessageBox.alert('你好呀2', '提示1', {
        //   message: h('p', null, [
        //     h('span', null, '内容可以是 '),
        //     h('i', { style: 'color: teal' }, 'VNode')
        //   ]),
        //   callback: (action, instance) => {
        //      console.log(action, 'action')
        //      console.log(instance, 'instance')
        //   },
        //   type: 'error'
        // })
      this.visible = true
      // this.option.img = data[0]
      
      // this.srcArr = ['https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg','https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg']
      // console.log(data, 'onSuccess')
    },
    dataChange (data, oldVal) {
      console.log(data, oldVal, 'dataChange')
    },
    deleteFile (data, oldData) {
      console.log(data, oldData, 'deleteFile')
    }
  }
}
</script>
